﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MadLibrary.Collections;
namespace MadLibrary.Managing.Products
{
    /// <summary>
    /// Holds and manages collection of products.
    /// </summary>
    public class Products : Collection<Product>
    {
        /// <summary>
        /// Initializes a new instance of the <see cref="Products"/> class.
        /// </summary>
        public Products() : base()
        { 
            
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="Products"/> class.
        /// </summary>
        /// <param name="Products">The products which have to be used as default for new product collection.</param>
        public Products(params Product[] Products) : base(Products)
        { 
            
        }

        /// <summary>
        /// Sets the products' category.
        /// </summary>
        /// <param name="Category">The category which has to be set to all products in current collection.</param>
        public void SetProductsCategory(ProductCategory Category)
        {
            foreach (Product p in this)
                p.Category = Category;
        }
    }
}
